Skip to content

fix(isthmus): fix argument order for trim function mapping#714

Merged
andrew-coleman merged 1 commit intosubstrait-io:mainfrom
nielspardon:par-trim
Mar 2, 2026
Merged

fix(isthmus): fix argument order for trim function mapping#714
andrew-coleman merged 1 commit intosubstrait-io:mainfrom
nielspardon:par-trim

Conversation

@nielspardon
Copy link
Member

The Calcite/SQL trim function has the following syntax:

TRIM(BOTH characters FROM input)
TRIM(LEADING characters FROM input)
TRIM(TRAILING characters FROM input)

https://calcite.apache.org/docs/reference.html#character-string-operators-and-functions

While the Substrait trim, ltrim, rtrim functions are defined as:

trim(input, characters)
ltrim(input, characters)
rtrim(input, characters)

https://github.com/substrait-io/substrait/blob/ee109ad48f149f2e3706d51b597febe86b79b225/extensions/functions_string.yaml#L1299-L1363

This PR fixes the argument order for the trim function mapping in isthmus by swapping the input and characters arguments during conversion.

Signed-off-by: Niels Pardon <par@zurich.ibm.com>
@andrew-coleman andrew-coleman merged commit 45750bf into substrait-io:main Mar 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants